class Solution:
    def hammingDistance(self, x, y):
        """
        :type x: int
        :type y: int
        :rtype: int
        """
        if x == y:
            return 0

        import re
        pattern = re.compile(r'1')
        return len(list(pattern.finditer(bin(x ^ y))))
            

s = Solution()
print(s.hammingDistance(0, 1))
print(s.hammingDistance(1, 4))
print(s.hammingDistance(4, 14))
